package com.bonait.bannerapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.youth.banner.Banner;
import com.youth.banner.indicator.CircleIndicator;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends Activity {

    private Banner banner;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initViews();
    }

    private void initViews() {
        banner = findViewById(R.id.banner);
        List<String> images = new ArrayList<>();
        images.add("https://img1.baidu.com/it/u=2102736929,2417598652&fm=26&fmt=auto");
        images.add("https://img0.baidu.com/it/u=3474134449,1474073850&fm=26&fmt=auto");
        images.add("https://img0.baidu.com/it/u=1292519680,571728152&fm=26&fmt=auto");
        banner.setAdapter(new ImageAdapter(images, this)).setIndicator(new CircleIndicator(this)).start();
    }
}